package io.huaguoguo.controller;

import cn.hutool.extra.servlet.ServletUtil;

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 描述：  <br>
 * CreateDate: 2021/11/21 <br>
 *
 * @author huaguoguo
 */
public class HelloServlet extends HttpServlet {


    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String name = request.getParameter("name");
        Cookie gads = ServletUtil.getCookie(request, "dc_sid");
        PrintWriter writer = response.getWriter();
        writer.print("hello:" + name);
        writer.flush();
        writer.close();
    }
}
